package r6.powtorka;

import java.text.NumberFormat;
import java.util.Arrays;
import java.util.Date;

public class Daty {
	
	private final int[] licznik = new int[1];
	private Date[] daty = new Date[100000];
	
	@SuppressWarnings("serial")
	public void go() {
		for (int i = 0; i < daty.length; i++) {
			daty[i] = new Date((int) (Math.random() * 2500000)){
				@Override
				public int compareTo(Date other){
					licznik[0]++;
					return super.compareTo(other);
				}
			};
		}
		
		Arrays.sort(daty);
		System.out.println(NumberFormat.getIntegerInstance().format(licznik[0]));
	}

}
